//
//  MovieListTableViewCell.m
//  豆瓣(阿黄)
//
//  Created by dllo on 15/10/27.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "MovieListTableViewCell.h"
#import "UIImageView+WebCache.h"

@implementation MovieListTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{

    [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createCell];
    }
    return self;
}


- (void)createCell{

    self.bgImage = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 355, 140)];
    self.bgImage.image = [UIImage imageNamed:@"bg_eventlistcell@2x.png"];
    [self.contentView addSubview:self.bgImage];
    [self.bgImage release];
    
    self.picImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 5, 100, 130)];
//    self.picImageView.backgroundColor = [UIColor grayColor];
    [self.bgImage addSubview:self.picImageView];
    [self.picImageView release];
    
    self.movieLabel = [[UILabel alloc] initWithFrame:CGRectMake(120, 50, 220, 50)];
//    self.movieLabel.backgroundColor = [UIColor grayColor];
    self.movieLabel.font = [UIFont systemFontOfSize:20];
    [self.bgImage addSubview:self.movieLabel];
    [self.movieLabel release];
}

- (void)sendValue:(Movie *)movie{

    self.movieLabel.text = movie.movieName;
    NSURL *url = [NSURL URLWithString:movie.pic_url];
    [self.picImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"placeHoderImage.png"]];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
